/* indent size: 2 */

module.exports = app => {
  const DataTypes = app.Sequelize;

  const Model = app.model.define('service_staff', {
    svc_staff_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      autoIncrement:true
    },
    name: {
      type: DataTypes.STRING(50),
      allowNull: false
    },
    sex: {
      type: DataTypes.INTEGER(4),
      allowNull: false
    },
    birth: {
      type: DataTypes.INTEGER(4),
      allowNull: false
    },
    pic: {
      type: DataTypes.STRING(200),
      allowNull: false
    },
    phone: {
      type: DataTypes.CHAR(11),
      allowNull: false
    },
    pwd: {
      type: DataTypes.STRING(100),
      allowNull: false
    },
    id_card_num: {
      type: DataTypes.CHAR(18),
      allowNull: false
    },
    address: {
      type: DataTypes.STRING(100),
      allowNull: false
    },
    score: {
      type: DataTypes.FLOAT,
      allowNull: false,
      defaultValue:0.00,
    },
    status: {
      type: DataTypes.INTEGER(4),
      allowNull: false,
      defaultValue:1,
    },
    last_svc_time: {
      type: DataTypes.TIME,
      allowNull: false,
      defaultValue:'0000-00-00 00:00:00'
    },
    cur_month_svc_cnt: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      defaultValue: 0,
    },
    cur_month_svc_abn_cnt: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      defaultValue: 0,
    },
    community_id_list: {
      type: DataTypes.STRING(255),
      allowNull: false,
      defaultValue:""
    },
    ctime: {
      type: DataTypes.TIME,
      allowNull: false,
      defaultValue:DataTypes.literal('CURRENT_TIMESTAMP')
    },
    mtime: {
      type: DataTypes.TIME,
      allowNull: false,
      defaultValue:DataTypes.literal('CURRENT_TIMESTAMP')
    },
    town_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
    }

  }, {
    tableName: 'service_staff'
  });

  Model.associate = function() {

  }

  return Model;
};
